package com.aaa.system.controller;

import com.aaa.entity.BBusinessInfo;
import com.aaa.system.service.BusinessInfoService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/system/businessInfo")
public class BusinessInfoController {


    @Autowired
    private BusinessInfoService businessInfoService;

    @GetMapping("/getByName/{telephone}")
    public BBusinessInfo getByName(@PathVariable String telephone){
        QueryWrapper<BBusinessInfo> wrapper = new QueryWrapper<>();
        wrapper.eq("status",0);
        wrapper.eq("telephone",telephone);
        BBusinessInfo one = businessInfoService.getOne(wrapper);
        return one;
    }

    @PostMapping("/buinessFreeze/{telephone}")
    public BBusinessInfo buinessFreeze(@PathVariable String telephone){
        BBusinessInfo businessInfo = businessInfoService.buinessFreezeName(telephone);
        return businessInfo;
    }


}
